#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    int n = 0, m = 0, arr[6][6] = { 0 };
    scanf("%d %d", &n, &m);
    int i = 0, j = 0;
    for (i = 0; i < n; i++)
    {
        int j = 0;
        for (j = 0; j < m; j++)
        {
            scanf("%d ", &arr[i][j]);
        }
    }
    int x = 0, y = 0;
    scanf("%d %d", &x, &y);
    printf("%d", arr[x - 1][y - 1]);
    return 0;
}